<?php

class Adept_Component_Set extends Adept_Component_Base 
{
    
    protected $name;
    protected $value;
    
    public function processRequest()
    {
        $this->doSet();
    }
    
    public function render()
    {
    	$this->doSet();
    }
    
    public function doSet() 
    {
    	$context = Adept_Context::getInstance();
    	$context[$this->getName()] = $this->getValue();
    }	

    public function getName() 
    {
        if (!is_null($this->name)) {
            return $this->name;
        }
        return $this->getValueOfBinding('name', null);
    }
    
    public function setName($name) 
    {
        $this->name = $name;
    }
    
    public function getValue() 
    {
        if (!is_null($this->value)) {
            return $this->value;
        }
        return $this->getValueOfBinding('value', null);
    }
    
    public function setValue($value) 
    {
        $this->value = $value;
    }
    
}